var gulp = require('gulp');
var gulp_uglify = require('gulp-uglify');
var gulp_rename = require('gulp-rename');
var minify_css = require('gulp-minify-css');
// var imagemin = require('gulp-imagemin');
// var pngquant = require('imagemin-pngquant');
var smushit = require('gulp-smushit');

gulp.task('default',function(){
  gulp.src('./css/apple.css')
    .pipe(minify_css())
    .pipe(gulp_rename('apple.min.css'))
    .pipe(gulp.dest('./min'));
  gulp.src('./*.js')
    .pipe(gulp_uglify())
    .pipe(gulp_rename({suffix: '.min'}))
    .pipe(gulp.dest('./min'));
  gulp.src('./js/*.js')
    .pipe(gulp_uglify())
    .pipe(gulp_rename({suffix: '.min'}))
    .pipe(gulp.dest('./min'));
});

gulp.task('smushit', function (){
  gulp.src('img/**/*.{jpg,png}')
      .pipe(smushit())
      .pipe(gulp_rename({suffix:'.min'}))
      .pipe(gulp.dest('./imgmin'));
})
